package project;

import project.adapter.SourceOne;
import project.adapter.SourceTwo;
import project.entity.Ab;
import project.factory.Service;
import project.single.Singleton;

/**
 * Created with IntelliJ IDEA.
 * User: leep
 * Date: 15-8-20
 * Time: 下午2:38
 * To change this template use File | Settings | File Templates.
 */
public class Main {
	public static void main(String[] a) throws InterruptedException {
		Service service = new Service();
		Ab ab = service.getA();
		ab.talk();
		for (int i = 0; i != 0; i++) {
			new Runnable() {
				@Override
				public void run() {
					Singleton singleton = Singleton.getSingleton();
					System.out.println(singleton.time);
				}
			}.run();
			Thread.sleep(1000l);

		}

		SourceOne one = new SourceOne();
		SourceTwo two = new SourceTwo();
		one.method1();
		one.method2();
		System.out.println("----------------------");
		two.method1();
		two.method2();

	}
}
